home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Software für Mac-OS X / Entwickler-Tools / netbeans / modules / ext / djava.jar / koala / dynamicjava / tree / ArrayInitializer.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-03-14  |  1.9 KB  |  67 lines

  1. package koala.dynamicjava.tree;
  2.  
  3. import java.util.List;
  4. import koala.dynamicjava.tree.visitor.Visitor;
  5.  
  6. public class ArrayInitializer extends Expression {
  7.    public static final String CELLS = "cells";
  8.    public static final String ELEMENT_TYPE = "elementType";
  9.    private List cells;
  10.    private Type elementType;
  11.  
  12.    public List getCells() {
  13.       return this.cells;
  14.    }
  15.  
  16.    public void setCells(List var1) {
  17.       if (var1 == null) {
  18.          throw new IllegalArgumentException("l == null");
  19.       } else {
  20.          ((Node)this).firePropertyChange("cells", this.cells, this.cells = var1);
  21.       }
  22.    }
  23.  
  24.    public Type getElementType() {
  25.       if (this.elementType == null) {
  26.          throw new IllegalStateException("elementType == null");
  27.       } else {
  28.          return this.elementType;
  29.       }
  30.    }
  31.  
  32.    public void setElementType(Type var1) {
  33.       if (var1 == null) {
  34.          throw new IllegalArgumentException("t == null");
  35.       } else {
  36.          ((Node)this).firePropertyChange("elementType", this.elementType, this.elementType = var1);
  37.          if (var1 instanceof ArrayType) {
  38.             ArrayType var2 = (ArrayType)var1;
  39.  
  40.             for(Object var4 : this.cells) {
  41.                if (var4 instanceof ArrayInitializer) {
  42.                   ((ArrayInitializer)var4).setElementType(var2.getElementType());
  43.                }
  44.             }
  45.          }
  46.  
  47.       }
  48.    }
  49.  
  50.    public Object acceptVisitor(Visitor var1) {
  51.       return var1.visit(this);
  52.    }
  53.  
  54.    public ArrayInitializer(List var1) {
  55.       this(var1, (String)null, 0, 0, 0, 0);
  56.    }
  57.  
  58.    public ArrayInitializer(List var1, String var2, int var3, int var4, int var5, int var6) {
  59.       super(var2, var3, var4, var5, var6);
  60.       if (var1 == null) {
  61.          throw new IllegalArgumentException("cells == null");
  62.       } else {
  63.          this.cells = var1;
  64.       }
  65.    }
  66. }
  67.